package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 * @author hua
 * @since 2024-12-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_defective_product")
@NoArgsConstructor
public class DefectiveProductDo extends Model<DefectiveProductDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 主表id
     */
    @TableField("defective_id")
    private Long defectiveId;

    @TableField("product_id")
    private Long productId;

    /**
     * 处理数量
     */
    @TableField("quantity")
    private Integer quantity;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;

    @TableField("delete_time")
    private Date deleteTime;

    @TableField("delete_by")
    private Long deleteBy;

    public DefectiveProductDo(Long defectiveId, Long productId, Integer quantity) {
        this.defectiveId = defectiveId;
        this.productId = productId;
        this.quantity = quantity;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
